package Input;

import org.lwjgl.input.*;

public class BasicInput
	{
		public BasicInput()
		{
		}
		public int update()
			{
				
				int key=0;

				while (Keyboard.next()) {
					
					if (Keyboard.getEventKey() == Keyboard.KEY_DOWN) 
					{
						if(Keyboard.getEventKeyState())
							{
								key=1;
								System.out.println(Keyboard.getEventKey());		
							}
						else
							{
								key=11;
								System.out.println(Keyboard.getEventKey()+" released");	
							}
					}
					
					else if (Keyboard.getEventKey() == Keyboard.KEY_UP) 
						{
						if(Keyboard.getEventKeyState())
							{
								key=2;
								System.out.println(Keyboard.getEventKey());			
							}
						else
							{
								key=12;
								System.out.println(Keyboard.getEventKey()+" released");	
							}
						}
					
					else if (Keyboard.getEventKey() == Keyboard.KEY_LEFT) 
						{
						if(Keyboard.getEventKeyState())
							{
								key=3;
								System.out.println(Keyboard.getEventKey());			
							}
						else
							{
								key=13;
								System.out.println(Keyboard.getEventKey()+" released");	
							}
						}
					
					else if (Keyboard.getEventKey() == Keyboard.KEY_RIGHT) 
						{
						if(Keyboard.getEventKeyState())
							{
								key=4;
								System.out.println(Keyboard.getEventKey());			
							}
						else
							{
								key=14;
								System.out.println(Keyboard.getEventKey()+" released");	
							}
						}
                    else if (Keyboard.getEventKey() == Keyboard.KEY_SPACE)
                    {
                        if(Keyboard.getEventKeyState())
                        {
                            key=5;
                            System.out.println(Keyboard.getEventKey());
                        }
                        else
                        {
                            key=15;
                            System.out.println(Keyboard.getEventKey()+" released");
                        }
                    }
					
				}
			return key;
			}

	}
